package com.hbnu.system.controller;

import com.hbnu.system.core.base.Rest;
import com.hbnu.system.model.vo.ChildrenNameId;
import com.hbnu.system.service.IProjectTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/projecttype")
@Api(tags = "项目类型数据模块")
public class ProjectTypeConntroller {
    @Autowired
    private IProjectTypeService iProjectTypeService;

    @ApiOperation("项目类型数据级联数据格式")
    @GetMapping("/getCascadingData")
    public Rest<List<ChildrenNameId>> getCascadingData(){
        List<ChildrenNameId> cascadingData = iProjectTypeService.getCascadingData();

        return Rest.success(cascadingData);
    }

    @ApiOperation("纵向项目类型数据级联数据格式")
    @GetMapping("/getPorCascadingData")
    public Rest<List<ChildrenNameId>> getPorCascadingData(){
        List<ChildrenNameId> cascadingData = iProjectTypeService.getPorCascadingData();

        return Rest.success(cascadingData);
    }

    @ApiOperation("横向项目类型数据级联数据格式")
    @GetMapping("/getTranCascadingData")
    public Rest<List<ChildrenNameId>> getTranCascadingData(){
        List<ChildrenNameId> cascadingData = iProjectTypeService.getTranCascadingData();

        return Rest.success(cascadingData);
    }
}
